﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Diagnostics;

namespace Meteorite
{
    public class Moveable
    {
        public float Mass
        {
            get { return mass; }
            set { mass = value; }
        }
        protected float mass = 1.0f;

        public Vector3 Position
        {
            get { return position; }
            set { position = value; }
        }
        protected Vector3 position;

        public Vector3 Force
        {
            get { return force; }
            set { force = value; }
        }
        protected Vector3 force;

        public Vector3 Velocity
        {
            get { return velocity; }
            set { velocity = value; }
        }
        protected Vector3 velocity;

        public void Stop()
        {
            velocity = Vector3.Zero;
        }

        public virtual void Update(GameTime gameTime)
        {
            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
            Vector3 acceleration = force / Mass;
            velocity += acceleration * elapsed;
            Position += velocity * elapsed;
            force = Vector3.Zero;

        }

    }

    
}
